// router/index.js
import { createRouter, createWebHistory } from 'vue-router';
import Index from '@/components/Index.vue';
import Login from '@/components/Login.vue';
import Home from '@/views/user/Home.vue'
import Employee from "@/views/base/Employee.vue";
import Product from "@/views/base/Product.vue";
import Details from "@/views/buyin/DetailsView.vue";
import Inbuy from "@/views/buyin/Inbuy.vue"
import Vendor from "@/views/buyin/Vendor.vue"
import Customer from "@/views/sellout/Customer.vue";
import Outsell from "@/views/sellout/OutsellView.vue"
import CountProduct from "@/views/count/CountProduct.vue";
import CountInbuy from "@/views/count/CountInbuy.vue";

const routes = [
  {
    path: '/',
    name: 'start',
    redirect: '/login'
  },
  {
    path: '/login',
    name: 'Login',
    component: Login,
  },
  {
    path: '/index',
    name: 'Index',
    component: Index,
    children: [
      {
        path: '/home',
        name: 'Home',
        component: Home,
      },
      {
        path: '/employee',
        name: 'Employee',
        component: Employee,
      },
      {
        path: '/product',
        name: 'Product',
        component: Product,
      },
      {
        path: '/details',
        name: 'Details',
        component: Details,
      },
      {
        path: '/inbuy',
        name: "Inbuy",
        component: Inbuy,
      },
      {
        path: '/vendor',
        name: 'Vendor',
        component: Vendor,
      },
      {
        path: '/customer',
        name: 'Customer',
        component: Customer,
      },
      {
        path: '/outsell',
        name: 'Outsell',
        component: Outsell,
      },
      {
        path: '/countProduct',
        name: 'CountProduct',
        component: CountProduct,
      }
      ,
      {
        path: '/countInbuy',
        name: 'CountInbuy',
        component: CountInbuy,
      }
    ]
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes,
});

export default router;
